import 'package:flutter/material.dart';
import 'WillPopScopeTestRoute.dart';
import 'InheritedWidgetTestRoute.dart';
import 'ThemeTestRoute.dart';

class FeaturesWidgetsPage extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return new _FeaturesWidgetsPageState();
  }
}

class _FeaturesWidgetsPageState extends State<FeaturesWidgetsPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Wrap(
          spacing: 8.0,
          runSpacing: 4.0,
          alignment: WrapAlignment.center,
          children: <Widget>[
            RaisedButton(
              colorBrightness: Brightness.dark,
              child: Text('导航返回拦截WillPopScope'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return new WillPopScopeTestRoute();
                    },
                  ),
                );
              },
            ),
            RaisedButton(
              colorBrightness: Brightness.dark,
              child: Text('数据共享InheritedWidget'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return new InheritedWidgetTestRoute();
                    },
                  ),
                );
              },
            ),
            RaisedButton(
              colorBrightness: Brightness.dark,
              child: Text('主题Theme'),
              onPressed: () {
                Navigator.push(
                  context,
                  new MaterialPageRoute(
                    builder: (context) {
                      return new ThemeTestRoute();
                    },
                  ),
                );
              },
            ),
          ],
        ),
      ),
    );
  }
}
